package net.wofly.finance.expense.util;

public enum ExpenseAccountStatus {
	
	草稿(10, "草稿"),
	待审批(20, "待审批"),
    审核通过(30, "审核通过"),
    驳回(39, "驳回"),
    己付款(40, "己付款"),
	己入帐完成(50, "己入帐完成"),
	取消(59, "取消");
    
    private Integer value;
    private String name;
    
    ExpenseAccountStatus(Integer value, String name) {
        this.value = value;
        this.name = name;
    }
    
    public static boolean isValueCorrect(Integer value) {
        for (ExpenseAccountStatus forEnum : values()) {
            if (value.equals(forEnum.getValue())) {
                return true;
            }
        }
        return false;
    }
    
    public static String getName(Integer value) {
        for (ExpenseAccountStatus forEnum : values()) {
            if (value.equals(forEnum.getValue())) {
                return forEnum.name;
            }
        }
        return null;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public Integer getValue() {
        return value;
    }
    
    public void setValue(Integer value) {
        this.value = value;
    }

}
